Function Reference

_GUICtrlEditGetModify

Retrieves the state of an edit control's modification flag.

#Include <GuiEdit.au3>
_GUICtrlEditGetModify($h_edit)

 

Parameters

$h_edit control id/control hWnd

 

Return Value

Success: Returns nonzero, if the contents of edit control have been modified.
Failure: Returns 0 otherwise.

 

Remarks

The system automatically clears the modification flag to zero when the control is created.
If the user changes the control's text, the system sets the flag to nonzero.
You can call _GUICtrlEditSetModify to set or clear the flag.

 

Related

_GUICtrlEditCanUndo, _GUICtrlEditEmptyUndoBuffer, _GUICtrlEditSetModify, _GUICtrlEditUndo

 

Example


#include <GUIConstants.au3>
#include <GuiEdit.au3>

opt('MustDeclareVars', 1)

Dim $myedit, $ret, $Status, $msg, $current

GUICreate("Edit Get Modify", 392, 254)

$myedit = GUICtrlCreateEdit("First line" & @CRLF, 140, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL)

$Status = GUICtrlCreateLabel("Un-Modified", 0, 234, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER))

GUISetState()

; Run the GUI until the dialog is closed
While 1
   $msg = GUIGetMsg()
   $ret = _GUICtrlEditGetModify ($myedit)
   If ($ret <> $current) Then
      If ($ret == 0) Then
         GUICtrlSetData($Status, "Un-Modified")
      Else
         GUICtrlSetData($Status, "Modified")
      EndIf
      $current = $ret
   EndIf
   If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd